<script setup lang="ts">
import GlobalSider from '@/components/GlobalSider.vue'
import WelcomeGuide from '@/components/WelcomeGuide.vue'
</script>

<template>
  <div id="basicLayout">
    <a-layout class="layout-container">
      <!-- 侧边栏 -->
      <a-layout-sider
        theme="light"
        class="sider"
        :style="{
          height: '100vh',
          position: 'fixed',
          left: 0,
          top: 0,
          bottom: 0,
          width: '280px !important',
          minWidth: '280px !important',
          maxWidth: '280px !important',
        }"
      >
        <GlobalSider />
      </a-layout-sider>
      <!-- 内容区域 -->
      <a-layout class="content-wrapper" :style="{ marginLeft: '280px' }">
        <a-layout-content class="content">
          <div class="content-background">
            <div class="circle-element circle-1"></div>
            <div class="circle-element circle-2"></div>
            <div class="circle-element circle-3"></div>
            <div class="dot-pattern dot-pattern-1"></div>
            <div class="dot-pattern dot-pattern-2"></div>
            <div class="wave-element wave-1"></div>
            <div class="wave-element wave-2"></div>
          </div>
          <div class="scrollable-content">
            <router-view></router-view>
          </div>
        </a-layout-content>
      </a-layout>
    </a-layout>

    <!-- 引导弹窗 -->
    <WelcomeGuide />
  </div>
</template>

<style scoped>
.layout-container {
  min-height: 100vh;
  height: 100vh;
  overflow: hidden;
  position: relative;
}

#basicLayout .sider {
  padding: 15px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.08);
  z-index: 1000;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 250, 250, 0.95));
  border-right: 1px solid rgba(24, 144, 255, 0.05);
}

#basicLayout .ant-layout-sider {
  min-width: 280px !important;
  width: 280px !important;
  max-width: 280px !important;
  flex: 0 0 280px !important;
}

.content-wrapper {
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#basicLayout .content {
  background: #f9fafb;
  padding: 30px;
  height: 100vh !important;
  overflow: hidden;
  position: relative;
}

/* 背景装饰元素 */
.content-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.circle-element {
  position: absolute;
  border-radius: 50%;
  filter: blur(1px);
  opacity: 0.6;
}

.circle-1 {
  top: -100px;
  right: -100px;
  width: 300px;
  height: 300px;
  background: linear-gradient(135deg, rgba(24, 144, 255, 0.08), rgba(65, 117, 232, 0.08));
}

.circle-2 {
  bottom: -80px;
  left: -80px;
  width: 250px;
  height: 250px;
  background: linear-gradient(135deg, rgba(24, 144, 255, 0.06), rgba(65, 117, 232, 0.06));
}

.circle-3 {
  top: 40%;
  right: 10%;
  width: 150px;
  height: 150px;
  background: linear-gradient(135deg, rgba(24, 144, 255, 0.04), rgba(65, 117, 232, 0.04));
}

.dot-pattern {
  position: absolute;
  width: 180px;
  height: 180px;
  background-image: radial-gradient(rgba(24, 144, 255, 0.1) 2px, transparent 2px);
  background-size: 18px 18px;
}

.dot-pattern-1 {
  top: 15%;
  left: 4%;
}

.dot-pattern-2 {
  bottom: 20%;
  right: 20%;
  width: 120px;
  height: 120px;
  opacity: 0.5;
  background-size: 14px 14px;
}

.wave-element {
  position: absolute;
  width: 200px;
  height: 100px;
  background: linear-gradient(
    -45deg,
    rgba(24, 144, 255, 0.05) 25%,
    transparent 25%,
    transparent 50%,
    rgba(24, 144, 255, 0.05) 50%,
    rgba(24, 144, 255, 0.05) 75%,
    transparent 75%,
    transparent
  );
  background-size: 20px 20px;
  border-radius: 12px;
}

.wave-1 {
  right: 5%;
  bottom: 8%;
}

.wave-2 {
  left: 25%;
  top: 12%;
  width: 150px;
  height: 80px;
  background-size: 15px 15px;
  opacity: 0.4;
  transform: rotate(20deg);
}

.scrollable-content {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0 30px;
  overflow-y: auto;
  z-index: 1;
  scroll-behavior: smooth;
  height: 100vh;
  padding-bottom: 30px;
}

.scrollable-content::-webkit-scrollbar {
  width: 6px;
}

.scrollable-content::-webkit-scrollbar-track {
  background: transparent;
}

.scrollable-content::-webkit-scrollbar-thumb {
  background-color: rgba(24, 144, 255, 0.2);
  border-radius: 10px;
}

.scrollable-content::-webkit-scrollbar-thumb:hover {
  background-color: rgba(24, 144, 255, 0.4);
}
</style>
